This repository was archived by the owner on Jun 29, 2025. It is now read-only.
[Renovate] Update dependency realm/SwiftLint to from: "0.59.1" #421
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
from: "0.54.0"->from: "0.59.1"Release Notes
realm/SwiftLint (realm/SwiftLint)
v0.59.1Compare Source
Breaking
opaque_over_existentialopt-in rule as it causes too many false positivesthat can even lead to wrong-compilable code when
anyis required by a protocol thetype conforms to. In this case, using
somecan be totally valid even though theprotocol requirement is not reimplemented for the type causing behavioral changes.
SimplyDanny
Experimental
Enhancements
allowed_numbersoption to theno_magic_numbersrule.Martin Redington
Bug Fixes
v0.59.0Compare Source
Breaking
SimplyDanny
Experimental
swiftlint-devcommand line tool that's intended to help to develop SwiftLint by encapsulating repetitivetasks. It can already be used to generate templates for new rules including optional configurations and tests. Run
swift run swiftlint-dev rules template -hto get an overview of the command's usage and the available customizationoptions. To register new rules, run
swift run swiftlint-dev rules register.SimplyDanny
Enhancements
Add new option
ignores_multiline_stringstoline_lengthrule. It allows to ignore too longlines inside of multiline strings.
thisIsTheFoxe
#2689
Ignore
UIColorinitializers inno_magic_numbersrule.suojae
hyeffie
#5183
Exclude types with a
@Suiteattribute and functions annotated with@Testfromno_magic_numbersrule.Also treat a type as a
@Suiteif it contains@Testfunctions.SimplyDanny
#5964
Add new
opaque_over_existentialopt-in rule that triggers when the existentialanytype of afunction parameter can be replaced with an opaque
sometype.SimplyDanny
Add a new rationale property to rule descriptions, providing a more expansive
description of the motivation behind each rule.
Martin Redington
#5681
Add new
allowed_typesoption tolegacy_objc_typerule to ignore certain types.kapitoshka438
#3723
Add
excluded_methodsconfiguration option tounneeded_overrideto opt out checking methods with a given name.For example, this helps avoid a conflict with
balanced_xctest_lifecyclewhere one ofsetUp/tearDownis empty but the other is not.
jaredgrubb
Bug Fixes
Fix issue referencing the Tests package from another Bazel workspace.
jszumski
Fix crash when a disable command is preceded by a unicode character.
SimplyDanny
#5945
Allow severity of
duplicate_importsrule to be configurable.SimplyDanny
#5978
Silence
no_magic_numbersrule in conditions of#ifdirectives.SimplyDanny
#6000
Consider types restricting a protocol to classes in composed inherited types in
class_delegate_protocolrule.SimplyDanny
#5982
Rewrite
type_contents_orderrule with SwiftSyntax fixing an issue with experimental availability macros.SimplyDanny
#5999
Update
file_namerule to considermacrotypes.fraioli
#6026
v0.58.2Compare Source
Breaking
Experimental
Enhancements
Bug Fixes
SimplyDanny
#5966
v0.58.1Compare Source
Breaking
If you are referring to the
swiftlintbinary from an Artifact Bundle consumed via Swift Package Managerin an Xcode Run Script Build Phase, make sure to update the path from
to
in order to make Xcode use the binary built for macOS.
SimplyDanny
#5954
Revert changes to improve performance when exclude patterns resolve to a large set of files. While resolving files
indeed got much faster in certain setups, it leads to missed exclusions for nested configurations and when the linted
folder is not the current folder.
SimplyDanny
#5953
Experimental
Enhancements
Bug Fixes
Fix
redundant_sendablecorrection by removing a remaining trailing comma as well whenSendablewas last.SimplyDanny
#5952
Remove lints for
redundant_sendableon protocols, whereSendableis not redundant.riley-williams
#5958
Add
ib_segue_actionto default configuration oftype_contents_orderrule on the same level asib_actiontodefine and document a standard position.
SimplyDanny
#5524
v0.58.0Compare Source
Breaking
The command plugin now requires write permissions so that it works with the
--fixoption without an error.SimplyDanny
The artifact bundle name has changed.
SwiftLintBinary-macos.artifactbundle.zipis now calledSwiftLintBinary.artifactbundle.zip. It now includes an AMD64 Linux binary.Bradley Mackey
#5514
The
inert_deferandunused_capture_listrules have completely been removed after being deprecated for 2 years.SimplyDanny
SwiftLint now requires a Swift 5.10 or higher compiler to build.
The Swift Package Manager plugins continue to work with
Swift 5.9.
SimplyDanny
The
private_unit_testrule's deprecatedregexconfiguration option has been removed after 2 years.Martin Redington
#5912
Experimental
Enhancements
Add Xcode command plugin allowing to run SwiftLint from within Xcode.
SimplyDanny
Add new
async_without_awaitopt-in rule that checks if anasyncdeclaration contains at least oneawait.Jan Kolarik
#5082
Support replacing identity expressions with
\.selfinprefer_key_pathrule from Swift 6 on.SimplyDanny
Support linting only provided file paths with command plugins.
DanSkeel
Add new category for
@IBSegueActiontotype_contents_orderrule.dk-talks
SimplyDanny
Add option to disable
redundant_discardable_letrule in SwiftUI view bodies.SimplyDanny
#3855
Add new
redundant_sendablerule that triggers onSendableconformances oftypes that are implicitly already
Sendabledue to being actor-isolated. Itis enabled by default.
SimplyDanny
Improve performance when exclude patterns resolve to a large set of files.
SimplyDanny
#5018
Bug Fixes
Ignore TipKit's
#Rulemacro inempty_countrule.Ueeek
#5883
Ignore super calls with trailing closures in
unneeded_overriderule.SimplyDanny
#5886
If violations are detected by
lintoranalyze, still perform an updatecheck for new versions of SwiftLint if requested.
Martin Redington
#5904
v0.57.1Compare Source
Breaking
Experimental
Enhancements
Suggest failable
String(bytes:encoding:)initializer inoptional_data_string_conversionrule as it accepts allSequencetypes.
Jordan Rose
SimplyDanny
Support reading files to lint from Input File Lists provided
by Run Script Build Phases in Xcode using the command-line
argument
--use-script-input-file-lists.BlueVirusX
Adds a
lenientconfiguration file setting, equivalent to the--lenientcommand line option.
Martin Redington
#5801
Support type casting on configuration option values defined by environment variables.
Without a cast, these values would always be treated as strings leading to a potentially
invalid configuration.
SimplyDanny
#5774
Add new option
max_number_of_single_line_parametersthat allows only the specified maximumnumber of parameters to be on one line when
allows_single_line = true. If the limit isexceeded, the rule will still trigger. Confusing option combinations like
allows_single_line = falsetogether with
max_number_of_single_line_parameters > 1will be reported.kimdv
SimplyDanny
#5781
The
redundant_type_annotationrule gains a new option,ignore_properties, that skips enforcement on members in atype declaration (like a
struct). This helps the rule coexist withthe
explicit_type_interfacerule that requires such redundancy.jaredgrubb
#3750
Allow inherited isolation parameter to be first in function signatures
depending on the new option
ignore_first_isolation_inheritance_parameterwhich is
trueby default.SimplyDanny
#5793
Bug Fixes
Run command plugin in whole package if no targets are defined in the
package manifest.
SimplyDanny
#5787
Silence
superfluous_elserule onifexpressions with only a singleavailability condition.
SimplyDanny
#5833
Stop triggering the
control_statementrule on closures being directlycalled as conditions.
SimplyDanny
#5846
Do not trigger
self_in_property_initializationrule onselfinkey paths expressions.
SimplyDanny
#5835
Allow to specify transitive modules to be taken into account by
unused_importrule. This avoids that required imports are removed.Paul Taykalo
SimplyDanny
#5167
Only pass cache path and directory paths to commands that accept these arguments
in the command plugin.
SimplyDanny
#5848
Do not throw deprecation warning if deprecated property is not
presented in configuration.
chipp
#5791
The
prefer_type_checkingrule will no longer trigger for non-optionaltype casting (
as), or for comparisons to optional types.Martin Redington
#5802
Fixes an issue where the
superfluous_disable_commandrule could generatefalse positives for nested disable commands for custom rules.
Martin Redington
#5788
Fixes the
--only-rulecommand line option, when a default.swiftlint.ymlis absent. Additionally rules specified with
--only-ruleon the commandline can now be disabled in a child configuration, to allow specific
directories to be excluded from the rule (or from being auto-corrected by
the rule), and
--only-rulecan now be specified multiple timesto run multiple rules.
Martin Redington
#5711
Fixes
file_namerule to match fully-qualified names of nested types.Additionally adds a
require_fully_qualified_namesboolean option to enforcethat file names match nested types only using their fully-qualified name.
fraioli
#5840
Fixes an issue where the
vertical_whitespace_between_casesrule does notrecognize
@unknown default.Jared Grubb
#5788
v0.57.0Compare Source
Breaking
The deprecated
anyobject_protocolrule has now been removed.Martin Redington
#5769
Revert the part of the
non_optional_string_data_conversionrule that enforces non-failable conversions of
Datato UTF-8String. This is due to the fact that the data to be convertedcan be arbitrary and especially doesn't need to represent a valid
UTF-8-encoded string.
Sam Rayner
#5263
Experimental
Enhancements
Add
ignore_multiline_type_headersandignore_multiline_statement_conditionsoptions to
opening_bracerule to allow opening braces to be on a new line aftermultiline type headers or statement conditions. Rename
allow_multiline_functoignore_multiline_function_signatures.leonardosrodrigues0
#3720
Add new
optional_data_string_conversionrule to enforcefailable conversions of
Datato UTF-8String.Sam Rayner
#5263
The
no_magic_numbersrule will now ignore violations inSwiftUI's
Previewmacro.Martin Redington
#5778
Bug Fixes
superfluous_disable_commandviolations are now triggered forcustom rules.
Marcelo Fabri
Martin Redington
SimplyDanny
#4754
Trailing comments are now preserved by the
opening_bracerule whenrewriting.
Martin Redington
#5751
v0.56.2Compare Source
Breaking
Experimental
Enhancements
Bug Fixes
Ignore initializers with attributes in
unneeded_synthesized_initializerrule.SimplyDanny
#5153
Silence
prefer_key_pathrule on macro expansion expressions.SimplyDanny
#5744
Check
ifexpressions nested arbitrarily deep incontrasted_opening_bracerule.SimplyDanny
#5752
Align left closure brace with associated parent function call in
contrasted_opening_bracerule.SimplyDanny
#5752
Align left brace of additional trailing closures with right brace of previous trailing closure
in
contrasted_opening_bracerule.SimplyDanny
#5752
Trigger on empty closure blocks in
no_empty_blockrule.SimplyDanny
#5762
Silence
unneeded_overriderule on methods and initializers with attributes.SimplyDanny
#5753
v0.56.1Compare Source
Breaking
Experimental
Enhancements
Bug Fixes
contrasted_opening_bracebe an opt-in rule.SimplyDanny
v0.56.0Compare Source
Breaking
The deprecated
--pathand--in-process-sourcekitarguments have now beenremoved completely.
Martin Redington
SimplyDanny
#5614
When SwiftLint corrects violations automatically (
swiftlint lint --fix)it doesn't report the exact location of the fix any longer. The new format
is
<file-path>: Correcting <rule-name>without line and column numbers.Reason: Correction positions are likely just incorrect, especially when
multiple rules apply their rewrites. Fixing that is not trivial and likely
not worth the effort also considering that there haven't been any bug
reports about wrong correction positions so far.
SimplyDanny
Experimental
Enhancements
Add new
attribute_name_spacingrule to enforce no trailing whitespace betweenattribute names and parentheses, ensuring compatibility with Swift 6, where this spacing
causes compilation errors.
aryamansharda
#5667
Linting got up to 30% faster due to the praisworthy performance
improvements done in the SwiftSyntax
library.
Rewrite the following rules with SwiftSyntax:
missing_docswoxtu
SimplyDanny
Add new
prefer_key_pathrule that triggers when a trailing closure on a standardfunction call is only hosting a (chained) member access expression since the closure
can be replaced with a key path argument. Likewise, it triggers on closure arguments.
SimplyDanny
Adds
baselineandwrite_baselineconfiguration file settings, equivalentto the
--baselineand--write-baselinecommand line options.Martin Redington
#5552
Add
no_empty_blockopt-in rule to validate that code blocks are not empty.They should at least contain a comment.
Ueeek
#5615
Add new
contrasted_opening_bracerule that enforces openingbraces to be on a separate line after the preceding declaration.
SimplyDanny
Add new
unused_parameterrule that triggers on function/initializer/subscriptparameters that are not used inside of the function/initializer/subscript.
SimplyDanny
#2120
Support
--targetpaths being passed to command plugin by Xcode.SimplyDanny
#5603
Add modified configurations to examples in rule documentation.
SimplyDanny
Add new option
evaluate_effective_access_control_leveltomissing_docsrule. Setting it to
truestops the rule from triggering on declarationsinside of types with lower visibility. These declarations effectively
have at most the same access level.
SimplyDanny
Add new
--check-for-updatescommand line option for thelint,analyze,and
versionsubcommands to check for new versions of SwiftLint, and anequivalent
check_for_updatesconfiguration file setting.Martin Redington
SimplyDanny
Ian Leitch
#5613
Add new
--only-rulecommand line option for thelintandanalyze,subcommands that overrides configuration file rule enablement and
disablement, in particular to facilitate running
--fixfor single ruleswithout having to temporarily edit the configuration file.
Martin Redington
#5666
Bug Fixes
Fix a few false positives and negatives by updating the parser to support
Swift 6 with all its new language constructs.
SimplyDanny
Stop triggering
markrule on "mark" comments in the middle of anothercomment.
SimplyDanny
#5592
Don't consider specialized imports with attributes as duplicates in
duplicate_importsrule.SimplyDanny
#5716
Use correct types and relative paths in SARIF reporter output. Generally
avoid escaping slashes in JSON output as well.
SimplyDanny
#5598
#5599
Keep initializers with attributed parameters in
unneeded_synthesized_initializerrule.SimplyDanny
#5153
Make
vertical_whitespace_between_casesrule work forcases ending with a string literal.
ilendemli
#5612
Ignore access level modifiers restricted to value setting in
extension_access_modifierrule.SimplyDanny
#5623
Fix
baseline compareincorrectly reporting some violationsas new, and also now sorts the violations from
baseline comparedeterministically.
Martin Redington
#5606
Fix rewriting for
implicit_returnrule when violations arenested within each other.
Martin Redington
#5660
Fix
opening_bracecorrection and make sure that disable commandsare taken into account before applying a fix.
swiftty
SimplyDanny
#5598
Violations of the
typesafe_array_initrule will now be correctlyreported as such, instead of as violations of the
array_initrule.
Martin Redington
#5709
v0.55.1Compare Source
Breaking
Experimental
Enhancements
static_over_final_classrule's violation message.SimplyDanny
#5570
Bug Fixes
Fix Bazel build when
bzlmodis not in use by adding transitive dependenciesexplicitly.
SimplyDanny
#5568
Treat condionally activatable variable declarations and initializer as if
they were always active in
unneeded_synthesized_initializerrule to avoidcompilation issues when unexpected items are there after all.
SimplyDanny
#5574
Silence
unused_enumeratedrule when$0in a closure is explicitly unpacked.SimplyDanny
#5573
Remove redundant initializers in
unneeded_overriderule only when checkinginitializers is actually enabled in the configuration.
SimplyDanny
#5571
Respect comments before opening brace in
opening_bracerule when there isone space before the brace after the comment. Everything else is still a
violation, yet the rewriter will not remove the comment anymore.
SimplyDanny
#5578
v0.55.0Compare Source
Breaking
Rewrite
SwiftLintBuildToolPluginusingBUILD_WORKSPACE_DIRECTORYwithout relyingon the
--configoption.Garric Nahapetian
Introduce SwiftLintCommandPlugin.
Rename SwiftLintBuildToolPlugin.
Add Swift Package Manager installation instructions.
garricn
Fix Code Climate reporter output by having lower case severity
values to comply with the Code Climate specification.
waitButY
The
superfluous_disable_commandrule will now be enabled for theanalyzecommand, unless it has been disabled, and will warn about superfluous
disablement of analyzer rules.
Martin Redington
#4792
With the introduction of the
consider_default_literal_types_redundantoption to the
redundant_type_annotationrule,Boolliterals will nolonger be considered redundant by default. Set this option to true to
preserve the previous behavior.
Garric Nahapetian
Experimental
lintandanalyzecommands:--write-baselineto save a baseline to disk, and
--baselineto read a saved baseline anduse it to filter out detected pre-existing violations. A new
baselinecommand uses the reporters to print the violations in a baseline.
Martin Redington
#5475
#3421
Enhancements
Add a reporter that outputs violations in the Static
Analysis Results Interchange Format (SARIF).
waitButY
Ignore absence of a non-initial local config instead of
falling back to default.
kohtenko
Add new option
ignore_typealiases_and_associatedtypestonestingrule. It excludestypealiasandassociatedtypedeclarations from the analysis.
marunomi
#3183
Prevent from compiling
SwiftLinttarget when only usingSwiftLintPluginon macOS.Julien Baillon
#5372
Allow to set the severity of rules (if they have one) in the short form
rule_name: warning|errorprovided that no other attributes need to beconfigured.
SimplyDanny
Add new
ignore_one_linersoption toswitch_case_alignmentrule to ignore switch statements written in a single line.
tonell-m
#5373
Add new
shorthand_argumentrule that triggers on shorthand argumentslike
$0,$1, etc. in closures if they are too far away from thebeginning of the closure. Options allow further cases to always trigger.
SimplyDanny
#70
Warn when
--fixcomes together with--strictor--lenientas only--fixtakes effect then.
SimplyDanny
#5387
Add new
one_declaration_per_filerule that allows only asingle class/struct/enum/protocol declaration per file.
Extensions are an exception; more than one is allowed.
Muhammad Zeeshan
#2802
Add new
ignore_attributesoption toredundant_type_annotationrulethat allows disabling the rule for properties that are marked with at least
one of the configured attributes.
tonell-m
#5366
Rewrite the following rules with SwiftSyntax:
explicit_aclextension_access_modifieridentifier_namelet_var_whitespacemarkmultiline_literal_bracketsnestingnimble_operatoropening_braceorphaned_doc_commentredundant_type_annotationtrailing_closurevoid_returnSimplyDanny
kishikawakatsumi
Marcelo Fabri
swiftty
KS1019
tonell-m
Print invalid keys when configuration parsing fails.
SimplyDanny
#5347
Add new
final_test_caserule that triggers on non-final test classes.SimplyDanny
Make
superfluous_elserule auto-correctable.SimplyDanny
Support other scope-exiting statements
continue,breakandthrowinsuperfluous_elserule.SimplyDanny
Trigger on
-> ()return signatures inreturn_value_from_void_functionrule. Moreover, support automatic fixes for obvious cases.
SimplyDanny
Refine violation position of
trailing_closurerule.SimplyDanny
Trigger on the declaration keyword (i.e.
let,var,func,subscript)instead of the
staticorclasskeywords in theexplicit_aclrule.SimplyDanny
Allow to configure more operators in
identifier_namerule. The new optionis named
additional_operators. Use it to add more operators to the listof default operators known to the rule.
SimplyDanny
#1762
Stop triggering
no_magic_numbersrule on literals used in rangeexpressions assigned to variables.
SimplyDanny
#5430
Add
affect_initializersoption to allowunneeded_overrideruleto affect initializers.
leonardosrodrigues0
#5265
Respect scattered disable commands in auto-correction of
duplicate_importsrule.
SimplyDanny
#5418
Add new
non_optional_string_data_conversionrule to enforcenon-failable conversions of UTF-8
String<->Data.Ben P
#5263
Refine violation position of
superfluous_elserule.SimplyDanny
Make
sorted_enum_casesrule's comparison case-insensitive toavoid unexpected ordering.
Oleg Kokhtenko
Add
excluded_lines_patternstoline_lengthto avoid linting linesthat contain one of the patterns.
kasrababaei
Make
empty_countauto-correctable.KS1019
Make
private_swiftui_stateauto-correctable.mt00chikin
Make
trailing_closurecorrectable.KS1019
Add new
static_over_final_classrule to preferstaticoverfinal classdeclaration.phlippieb
#5471
Extends
unused_enumeratedrule to cover closure parameters, todetect cases like
list.enumerated().map { idx, _ in idx }andlist.enumerated().map { $1 }.Martin Redington
#5470
Include
Double,IntandStringto the exiting redundant type validationcheck of
Boolin theredundant_type_annotationrule. Addconsider_default_literal_types_redundantoption supportingBool,Double,IntandString. Setting this option totruelets the ruleconsider said types in declarations like
let i: Int = 1orlet s: String = ""as redundant.Garric Nahapetian
Add new
prefer_type_checkingrule to prefera is Xovera as? X != nil.ikelax
mildm8nnered
#5295
Bug Fixes
Invalid keys in a configuration don't lead to the default configuration being
used anymore. The invalid key will just be reported but otherwise ignored.
SimplyDanny
#5565
Fix version comparison algorithm which caused some version-dependent rules to
misbehave with Swift 5.10.
chandlerwall
#5517
Silence
discarded_notification_center_observerrule in closures. Furthermore,handle
getandsetaccessors correctly and consider implicit returns.SimplyDanny
#4801
Fix some false positives in
let_var_whitespacerule that would happenwhen attributes attached to declarations were spread over multiple lines.
SimplyDanny
#4801
Support
private_over_fileprivaterule for actors.SimplyDanny
#5489
Ensure that declarations referenced only as extended types do not count as
used by means of the
unused_declarationrule.SimplyDanny
#5550
Fix some false positives in
multiline_literal_bracketsrule that wouldhappen when comments are present.
Marcelo Fabri
Fix some false positives in the
opening_bracerule.kishikawakatsumi
SimplyDanny
#4610
#5114
#3470
#3574
#2632
#3476
#3756
#3690
Ignore overridden functions with default parameters in the
unneeded_overriderule as they might change behavior.
SimplyDanny
#5355
Trigger
nsobject_prefer_isequalandredundant_self_in_closureeven in casethe surrounding declaration is nested in an extension.
SimplyDanny
Fixed false positives for the
no_magic_numbersrule, when theyare defined in a tuple like
let (a, b) = (5, 10)orlet a = (2, 3).Martin Redington
#5305
Take array and nested types into account in
redundant_type_annotationrule.SimplyDanny
#3141
#3146
Silence
pattern_matching_keywordsrule when an identifier is referencedin the argument list of a matching enum case.
SimplyDanny
#3852
Don't trigger the
return_value_from_void_functionwarning from initializers.mrbkap
Fixes superfluous warnings about configurations for rules that were not
enabled, when the rules were enabled in a parent configuration.
Martin Redington
#4858
Add
allpseudo-rule foranalyzer_rules- enables all analyzer rulesthat are not listed in
disabled_rules.woxtu
Martin Redington
#4999
Updates the reasons provided by violations of the
blanket_disable_commandto omit language about the end of the file, and to direct users to
re-enable the rule as soon as possible.
Martin Redington
#5450
Add a
--working-directorycommand line option, for users who cannototherwise control which directory SwiftLint is run from.
Martin Redington
#5424
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.